<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>众信易运维系统</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
   <script src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
<h1>{{ title }}</h1>
<ul class="list-unstyled">
{% if request.user.is_authenticated %}
    <div class="clearfix">
 <form class="navbar-form navbar-left" role="search" method="get" action="{% url 'posts:result' %}">
               <div class="form=group">
                   <input type="text"  style="width: 700px;overflow-x:visible;overflow-y:visible;" class="form-control" name="q" placeholder="SQL语句" value="{{ request.GET.q }}"/>

                   <button type="submit"  class="btn btn-default glyphicon glyphicon-chevron-right"> 跑一个 </button>
               </div>
           </form>
    </div>

    <li> <b class="clearfix"><a class="form=group pull-left" href="{% url "logout" %}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logout-></a></b></li>
    <br>
    {% else %}
    <li><b><a href="{% url "login" %}">->login</a></b></li>
{% endif %}
{% if request.user.is_authenticated %}
            <li><div class="clearfix">

               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog()"> 同步生产数据到测试credit_core </button>
               </div>

               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog1()"> 同步生产数据到测试real_core </button>
               </div>

               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog2()"> 3 </button>
               </div>


               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog3()"> 4 </button>
               </div>

            </div>
            </li>
          <!-- <li><div class="clearfix">
               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog4()"> 5 </button>
               </div>


               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog5()"> 6 </button>
               </div>


               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog6()"> 7 </button>
               </div>


               <div class="form=group pull-left">
                   <button type="button"  class="btn btn-primary btn-lg1" onclick="dailog7()"> 8 </button>
               </div>
            </div>
</li> -->
</ul>
<div>{{time}}</div>
<div>{{result1}}</div>
{% endif %}
                <div class="pull-left dailog">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok()"> Yes </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog1">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok1()"> Yes1 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No1 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog2">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok2()"> Yes2 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No2 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog3">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok3()"> Yes3 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No3 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog4">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok4()"> Yes4 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No4 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog5">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok5()"> Yes5 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No5 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog6">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok6()"> Yes6 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No6 </button></div>
                        </div>
                    </div>
                </div>

                <div class="pull-left dailog7">
                    <div class="content">
                        <div>是否执行???</div>
                        <div class="clearfix">
                            {% if request.user.is_staff %}
                            <div class="pull-left ok-btn"><button type="button"  class="btn btn-success " onclick="ok7()"> Yes7 </button></div>
                            {% endif %}
                            <div class="pull-right cancel-btn"><button type="button"  class="btn btn-warning cancel-btn" onClick="cancel();"> No7 </button></div>
                        </div>
                    </div>
                </div>

                <style>
                    .dailog{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog1{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog2{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog3{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog4{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog5{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog6{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .dailog7{
                        position: fixed;
                        left: 0;
                        top: 0;
                        right: 0;
                        bottom: 0;
                        background-color: rgba(0,0,0,.3);
                        display: none;
                    }
                    .content{
                        position: absolute;
                        left: 50%;
                        top: 50%;
                        width: 300px;
                        height: 200px;
                        margin-top: -100px;
                        margin-left: -150px;
                        background-color: #ffffff;
                        text-align: center;
                    }
                    .clearfix:after{
                        content: '';
                        display: block;
                        width: 0;
                        height: 0;
                        clear: both;
                        zoom: 1;
                    }
                    .pull-left{
                        float: left;
{#                        width: 50%;#}
                    }
                    .pull-right{
                        float: right;
{#                        width: 50%;#}
                    }
                    .btn{
                        margin-left: 20px;
                        margin-bottom: 20px;
                    }
                    .btn-lg1{
                          padding: 20px 100px;
                            font-size: 15px;
                            line-height: 2;
                            border-radius: 50px
                    }
                    .btn-primary{
                        color: black;
                        background-color: lightskyblue;
                    }

                </style>




</body>

<script>
    function cancel() {
       document.getElementsByClassName('dailog')[0].style.display = 'none';
       document.getElementsByClassName('dailog1')[0].style.display = 'none';
       document.getElementsByClassName('dailog2')[0].style.display = 'none';
       document.getElementsByClassName('dailog3')[0].style.display = 'none';
       document.getElementsByClassName('dailog4')[0].style.display = 'none';
       document.getElementsByClassName('dailog5')[0].style.display = 'none';
       document.getElementsByClassName('dailog6')[0].style.display = 'none';
       document.getElementsByClassName('dailog7')[0].style.display = 'none';
    }
    function ok() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge" %}";
    }
    function dailog(){
        document.getElementsByClassName('dailog')[0].style.display = 'block';
    }
	    function ok1() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge1" %}";
    }
    function dailog1(){
        document.getElementsByClassName('dailog1')[0].style.display = 'block';
    }
	    function ok2() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge2" %}";
    }
    function dailog2(){
        document.getElementsByClassName('dailog2')[0].style.display = 'block';
    }
	    function ok3() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge3" %}";
    }
    function dailog3(){
        document.getElementsByClassName('dailog3')[0].style.display = 'block';
    }
	    function ok4() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge4" %}";
    }
    function dailog4(){
        document.getElementsByClassName('dailog4')[0].style.display = 'block';
    }
	    function ok5() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge5" %}";
    }
    function dailog5(){
        document.getElementsByClassName('dailog5')[0].style.display = 'block';
    }
	    function ok6() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge6" %}";
    }
    function dailog6(){
        document.getElementsByClassName('dailog6')[0].style.display = 'block';
    }
    function ok7() {
        alert("请稍等")
        window.location.href="{% url "posts:jinge7" %}";
    }
    function dailog7(){
        document.getElementsByClassName('dailog7')[0].style.display = 'block';
    }

    document.getElementsByClassName('ok-btn')[0].onclick = function () {
        document.getElementsByClassName('dailog')[0].style.display = '111';
    }
    document.getElementsByClassName('cancel-btn')[0].onclick = function () {
        document.getElementsByClassName('dailog')[0].style.display = '111';
    }
</script>
</html>